package com.sduept.nwld.dataserver.enums;

import lombok.extern.slf4j.Slf4j;

/**
 * 此枚举用来记录 设备更新过程中的操作，以及设备更新的具体设备类型
 *
 */
@Slf4j
public enum EquipmentUpdateEnum {
	OPERATE_UPDATE("update"),
	OPERATE_DELETE("delete"),
	OPERATE_CREATE("create"),
	OPERATE_BATCHUPDATE("batchUpdate"),
	OPERATE_BATCHDELETE("batchDelete"),
	OPERATE_BATCHCREATE("batchCreate"),
	PRIMARY_ACLINESEGMENT("ACLineSegment"),
	PRIMARY_BASEPOWER("BasePower"),
	PRIMARY_BASEVOLTAGE("BaseVoltage"),
	PRIMARY_BREAKER("Breaker"),
	PRIMARY_BUSBARSECTION("BusbarSection"),
	PRIMARY_COMPENSATOR("Compensator"),
	PRIMARY_CONNECTIVITYNODE("ConnectivityNode"),
	PRIMARY_DCLINESEGMENT("DcLinesegment"),
	PRIMARY_DCPOLE("DCPole"),
	PRIMARY_DCSWITCH("DCSwitch"),
	PRIMARY_DCSYS("DCSys"),
	PRIMARY_DISCONNECTOR("Disconnector"),
	PRIMARY_ENERGYCONSUMER("EnergyConsumer"),
	PRIMARY_GENERATINGUNIT("GeneratingUnit"),
	PRIMARY_GROUNDDISCONNECTOR("GroundDisconnector"),
	PRIMARY_HOSTCONTROLAREA("HostControlArea"),
	PRIMARY_HYDROGENERATINGUNIT("HydroGeneratingUnit"),
	PRIMARY_POWERTRANSFORMER("PowerTransformer"),
	PRIMARY_SUBCONTROLAREA("SubControlArea"),
	PRIMARY_SUBSTATION("Substation"),
	PRIMARY_RECTIFIERINVERTER("RectifierInverter"),
	PRIMARY_SYNCHRONOUSMACHINE("SynchronousMachine"),
	PRIMARY_TAPCHANGER("TapChanger"),
	PRIMARY_TERMINAL("Terminal"),
	PRIMARY_THERMALGENERATINGUNIT("ThermalGeneratingUnit"),
	PRIMARY_TRANSFORMERWINDING("TransformerWinding"),
	PRIMARY_VOLTAGELEVEL("VoltageLevel"),
	PRIMARY_INCREMENTAL_UPDATE_END("primary_incremental_update_end");
	
	
	private String desc;
	
	private EquipmentUpdateEnum(String desc){
        this.desc=desc;
    }
    public String getDesc(){
        return desc;
    }
    public static EquipmentUpdateEnum val(String desc) {
        for(EquipmentUpdateEnum s : values()) {    
            if(desc.equals(s.getDesc()))
                return s;
        }
        return null;
    }
    public static void main(String[] args) {
    	int i=0;
		for(EquipmentUpdateEnum e:EquipmentUpdateEnum.values()) {
			log.info(e.name()+":"+e.getDesc());
			i++;
		}
		log.info(String.valueOf(i));
	}

}
